< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03010201.xhp

(section: inputbox) (bookmark: bm_id3148932)
InputBox function

InputBox 関数

InputBox Function [Runtime]
InputBox 関数 [実行時](hd_id3148932.1)

Displays a prompt in a dialog at which the user can input text. The input is assigned to a variable.
ユーザーによるテキスト入力を行うためのダイアログを表示します。入力された値は、変数に収める必要があります。(par_id3151262.2)

(/section: inputbox)

The InputBox statement is a convenient method of entering text through a dialog. Confirm the input by clicking OK or pressing Return. The input is returned as the function return value. If you close the dialog with Cancel, InputBox returns a zero-length string ("").
InputBox ステートメントを利用することで、ダイアログによるユーザー入力を簡単に実装できます。ユーザーの入力する値は、OK ボタンをクリックするか Return キーを押した段階で確定されます。こうして得られる入力値は、一種の関数の戻り値として返されます。また、Cancel ボタンをクリックしてダイアログを閉じると、InputBox は文字長ゼロの空白文字列 ("") を返します。(par_id3151100.3)

Syntax:
構文:(hd_id3152347.4)

InputBox (Msg As String[, Title As String[, Default As String[, x_pos As Integer, y_pos As Integer]]]])
InputBox (Msg As String[, Title As String[, Default As String[, x_pos As Integer, y_pos As Integer]]]])(par_id3159201.5)

Return value:
戻り値:(hd_id3150713.6)

String
文字列(par_id3145090.7)

Parameter:
パラメータ:(hd_id3149346.8)

Msg: String expression displayed as the message in the dialog box.
Msg:ダイアログボックスにメッセージとして表示させる文字列。(par_id3153311.9)

Title: String expression displayed in the title bar of the dialog box.
Title:ダイアログボックスのタイトルバーに表示させる文字列。(par_id3145315.10)

Default: String expression displayed in the text box as default if no other input is given.
Default:ユーザーが何も入力しない場合のデフォルト値としてテキストボックスに表示させる文字列。(par_id3154307.11)

x_pos: Integer expression that specifies the horizontal position of the dialog. The position is an absolute coordinate and does not refer to the window of the office application.
x_pos:ダイアログの水平位置を指定する整数表式。この位置指定は絶対座標によるもので、オフィスアプリケーションウィンドウに対するものではありません。(par_id3147573.12)

y_pos: Integer expression that specifies the vertical position of the dialog. The position is an absolute coordinate and does not refer to the window of the office application.
y_pos:ダイアログの垂直位置を指定する整数値。この位置指定は絶対座標によるもので、オフィスアプリケーションウィンドウに対するものではありません。(par_id3156024.13)

If x_pos and y_pos are omitted, the dialog is centered on the screen. The position is specified in twips.
x_pos および y_pos を省略した場合、ダイアログは画面中央に配置されます。位置の指定単位は twip です。(par_id3153897.14)

Example:
例:(hd_id3149456.15)

Sub ExampleInputBox
Sub ExampleInputBox(par_id3153379.16)

Dim sText As String
Dim sText As String(par_id3149656.17)

sText = InputBox ("Please enter a phrase:","Dear User")
sText = InputBox ("フレーズを入力してください: ","ようこそ")(par_id3154367.18)

MsgBox ( sText , 64, "Confirmation of phrase")
MsgBox ( sText , 64, "Confirmation of phrase")(par_id3151042.19)

End Sub
End Sub(par_id3150768.20)


< Prev / Next >